home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
T-COMAL Today
/
(k)t3.d64
/
convert(new).l
< prev
next >
Wrap
Text File
|
2007-02-28
|
1KB
|
57 lines
9000 // BY PERRY BRIKLEY OF P B SYSTEMS
9010 PROC CONVERT(AN,REF ALPH$,REF NUMB) CLOSED
9020 Z:=ZONE
9030 ZONE 0
9040 DIM OLD$ OF 12
9050 ROW:=PEEK(214); COL:=PEEK(211)
9060 PC:=PEEK(646) //CURRENT PENCOLOR
9070 BC:=PEEK(53281)-240 //CURRENT BACKGROUND
9080 PENCOLOR BC //SAME AS BACKGROUND
9090 // NEXT CLEAR TOP 12 POSITIONS
9100 PRINT CHR$(19), //HOME CURSOR
9110 OPEN FILE 126,"",UNIT 3,READ
9120 INPUT FILE 126: OLD$
9130 CLOSE FILE 126
9140 PRINT " ", //HOME-12 SPACES-HOME
9150 CASE AN OF
9160 WHEN 1 // CONVERT TO NUMBER
9170 IF ALPH$="" THEN
9180 ALPH$:="NV"
9190 ELSE
9200 PRINT ALPH$,
9210 ENDIF
9220 WHEN 2 // CONVERT TO STRING
9230 PRINT NUMB,
9240 WHEN 3 // CONVERT TO CHR$
9250 IF NUMB>=0 AND NUMB<=255 THEN
9260 PRINT CHR$(NUMB),
9270 ELSE
9280 ALPH$:="NV"
9290 ENDIF
9300 OTHERWISE
9310 ALPH$:="NV" //NOT VALID
9320 ENDCASE
9330 IF ALPH$<>"NV" THEN
9340 PULL'SCREEN(AN,ALPH$,NUMB)
9350 ENDIF
9360 PENCOLOR PC //BACK TO ORIGINAL
9370 PRINT "",OLD$
9380 POKE 214,ROW //RESTORE CURSOR POS
9390 POKE 209,(1024+ROW*40) MOD 256
9400 POKE 210,(1024+ROW*40) DIV 256
9410 POKE 211,COL
9420 ZONE Z //RESTORE ZONE SETTING
9430 ENDPROC CONVERT
9440 //
9450 PROC PULL'SCREEN(AN,REF ALPHA$,REF NUMBER) CLOSED
9460 PRINT CHR$(19), //HOME CURSOR
9470 OPEN FILE 93,"",UNIT 3,READ
9480 CASE AN OF
9490 WHEN 1
9500 INPUT FILE 93: NUMBER
9510 WHEN 2,3
9520 INPUT FILE 93: ALPHA$
9530 ENDCASE
9540 CLOSE FILE 93
9550 ENDPROC PULL'SCREEN